package com.xiangdao.model;

import java.text.SimpleDateFormat;
import java.util.Date;

public class PostMain {

    private Integer id;

    private String title; //标题

    private Integer commentNum; //评论数

    private Date time; //评论时间

    private Integer userid;//用户id


    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public String getTitle() {
        return title;
    }

    public void setTitle(String title) {
        this.title = title;
    }

    public Integer getCommentNum() {
        return commentNum;
    }

    public void setCommentNum(Integer commentNum) {
        this.commentNum = commentNum;
    }

    public Date getTime() {
        return time;
    }

    public void setTime(Date time) {
        this.time = time;
    }

    public PostMain() {
    }

    public Integer getUser_id() {
        return userid;
    }

    public void setUser_id(Integer user_id) {
        this.userid = user_id;
    }

    /**
     * 展示时间
     * @return 评论时间
     */
    public String displayParsedDate() {
        SimpleDateFormat formatter=new SimpleDateFormat("yyyy-MM-dd");
        return formatter.format(this.time);
    }

}

